<?php

use yii\helpers\Html;
use yii\helpers\Markdown;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

use app\assets\ArticleAsset;

/* @var $this yii\web\View */
/* @var $model app\models\Article */
ArticleAsset::register($this);

$this->title = $article->title;
$this->params['breadcrumbs'][] = ['label' => 'Articles', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="article-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <div class='article-content'>
        <?= Markdown::process($article->content) ?>
    </div>

    <div class='article-comments'>
        <div id="comments-list">
            <?= $this->render('/comment/list', ['article' => $article]); ?>
        </div>

        <?= $this->render('/comment/create', ['comment' => new app\models\Comment(['aid' => $article->id])]); ?>
    </div>

</div>
